import Vue from 'vue'
import VueRouter from 'vue-router'

// 导入路由配置
import enterprise from '@/router/modules/enterprise'
import searchAnxu from '@/router/modules/searchAnxu'
import qualifications from '@/router/modules/qualifications'
import mycustomer from '@/router/modules/mycustomer'
import userdistribution from '@/router/modules/userdistribution'
Vue.use(VueRouter)

const routes = [
  {
    path: '/register',
    component: () => import('@/views/register')
  },
  {
    path: '/login',
    component: () => import('@/views/login')
  },
  {
    path: '/',
    redirect: '/enterprise' // 重定向 打开页面直接跳转显示查企业页面
  },
  {
    path: '/import',
    component: () => import('@/views/layout'),
    children: [
      {
        path: '',
        component: () => import('@/views/import')
      }
    ]
  },
  enterprise,
  searchAnxu,
  qualifications,
  mycustomer,
  userdistribution
]
const router = new VueRouter({
  routes
})
export default router
